<?php session_start(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>List of participants</title>
<script language="javascript">   
 function confirme( identifiant )
 {
    var confirmation = confirm( "Do you really want to delete this record ?" ) ;
	if( confirmation )
	{
	  document.location.href = "suppressionParticipant.php?Delete="+identifiant ;
	}
  }
</script>

<?php $_SESSION['page_name']='Participant';include('Menu.php');?>
</head>

<body>
  <?php   
          $con= mysql_connect("localhost","root","");
        if(!$con){
die('Connection Error!:' . mysql_error());
}
mysql_select_db ("usabilityevaluation",$con);


$result = mysql_query("SELECT * FROM Participant") ; ?>
<table border='1'>
   <tr>
		<th >Participant ID</th>
		<th >Last Name</th>
		<th >First Name</th>
		<th >Sexe</th>
		<th >Right-handed</th>
		<th >Comment</th>
    </tr>
<?php while($row = mysql_fetch_array($result)){  ?> 
<?php /*?><form name="form" method="post" action="modifyParticipant.php?id=<?php echo $row['id_participant']?>"><?php */?>


 <tr>
  <td><input name="idParticipant" value=<?php echo $row['id_participant'] ?> disabled="disabled" /></td>
  <td><input name="ln" value="<?php echo $row['LastName'];?>" type="text"/></td>
  <td><input name="fn" value="<?php echo $row['FirstName'];?>" type="text"/></td>
   <?php if( $row['isMale'] ==1)
  		{?><td><input name="sexe" value="M" type="text"/></td>
   <?php } else { ?>
 		<td><input name="sexe" value="F" type="text"/></td><?php } ?> 

  <?php if( $row['isRightHanded'] ==1)
  		{?><td><input name="rightHanded" value="Yes" type="text"/></td>
   <?php } else { ?>
 		<td><input name="rightHanded" value="No" type="text"/></td><?php } ?> 	

  <td><input name="comment" value="<?php echo $row['Comment'];?>" type="text"/></td>
  <td border='0' bgcolor="#DBE6EE"> 
  
   <?php echo '<a href="modifParticipant1.php?Update=' . $row['id_participant'] . ' ">[Update]</a>'; ?>
   <?php echo "<a href=\"#\" onClick=\"confirme('".$row['id_participant']."')\" > [Delete]</a>";?>
 <?php /*?> <input type='submit' name='ModifyP' value='Update' /> 
  <input type='submit' name='DeleteP' value='DeleteP' /><?php */?>
  </td>
 </tr>

 <?php /*?> </form><?php */?>


 <?php } ?>  <!--</table><P align="right"><a href="indexParticipant.php">back to index of management of participants</a></P>
 <br/><br/><br/> -->
<?php
mysql_close($con);
        ?>
</body>
</html>
